import copy
from ytbase.model.auth_def import ROLE_USER, OPERATION_ADD
from ytbase.model.auth_def import AUTH_MODEL as auth
from ytbase.model.auth import get_auth as get_auth_old
from ytbase.model.auth import get_role, comp_role

AUTH_MODEL = copy.deepcopy(auth)
AUTH_MODEL['YTPost'][ROLE_USER][OPERATION_ADD] = False

def get_auth(obj, auth_model=AUTH_MODEL, check_parent=False, get_role=get_role, com_role=comp_role):
    return get_auth_old(obj, auth_model=AUTH_MODEL, check_parent=check_parent, get_role=get_role, com_role=comp_role)
